/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogSportByPatient.java
 *
 * Created on 14/09/2010, 21:53:45
 */
package systole.view.crud.patient.patientComponents.sports;

import org.jdesktop.application.Action;

/**
 *
 * @author jmj
 */
public class JDialogSportByPatient extends javax.swing.JDialog {

    private ControllerEditionSportByPatient controller;

    /** Creates new form JDialogSportByPatient
     * @param parent
     * @param controller
     */
    public JDialogSportByPatient(java.awt.Frame parent, ControllerEditionSportByPatient controller) {
        super(parent, true);
        initComponents();
        this.controller = controller;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPnlCenter = new javax.swing.JPanel();
        lblSport = new javax.swing.JLabel();
        cmbSport = new javax.swing.JComboBox();
        lblHoursPerWeek = new javax.swing.JLabel();
        jSpnHours = new javax.swing.JSpinner();
        jLblWhen = new javax.swing.JLabel();
        jSpnYears = new javax.swing.JSpinner();
        jLblYears = new javax.swing.JLabel();
        jPnlBottom = new javax.swing.JPanel();
        jBtnOk = new javax.swing.JButton();
        jBtnCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setModal(true);
        setName("Form"); // NOI18N
        setResizable(false);

        jPnlCenter.setName("jPnlCenter"); // NOI18N
        jPnlCenter.setPreferredSize(new java.awt.Dimension(365, 100));

        lblSport.setFont(lblSport.getFont().deriveFont(lblSport.getFont().getStyle() | java.awt.Font.BOLD));
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getResourceMap(JDialogSportByPatient.class);
        lblSport.setText(resourceMap.getString("lblSport.text")); // NOI18N
        lblSport.setName("lblSport"); // NOI18N

        cmbSport.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cmbSport.setToolTipText(resourceMap.getString("cmbSport.toolTipText")); // NOI18N
        cmbSport.setName("cmbSport"); // NOI18N

        lblHoursPerWeek.setFont(lblHoursPerWeek.getFont().deriveFont(lblHoursPerWeek.getFont().getStyle() | java.awt.Font.BOLD));
        lblHoursPerWeek.setText(resourceMap.getString("lblHoursPerWeek.text")); // NOI18N
        lblHoursPerWeek.setName("lblHoursPerWeek"); // NOI18N

        jSpnHours.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));
        jSpnHours.setToolTipText(resourceMap.getString("jSpnHours.toolTipText")); // NOI18N
        jSpnHours.setName("jSpnHours"); // NOI18N

        jLblWhen.setText(resourceMap.getString("jLblWhen.text")); // NOI18N
        jLblWhen.setName("jLblWhen"); // NOI18N

        jSpnYears.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));
        jSpnYears.setToolTipText(resourceMap.getString("jSpnYears.toolTipText")); // NOI18N
        jSpnYears.setName("jSpnYears"); // NOI18N

        jLblYears.setText(resourceMap.getString("jLblYears.text")); // NOI18N
        jLblYears.setName("jLblYears"); // NOI18N

        javax.swing.GroupLayout jPnlCenterLayout = new javax.swing.GroupLayout(jPnlCenter);
        jPnlCenter.setLayout(jPnlCenterLayout);
        jPnlCenterLayout.setHorizontalGroup(
            jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlCenterLayout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblSport, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblHoursPerWeek, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblWhen, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(10, 10, 10)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cmbSport, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jSpnHours, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPnlCenterLayout.createSequentialGroup()
                        .addComponent(jSpnYears, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLblYears)))
                .addContainerGap(47, Short.MAX_VALUE))
        );
        jPnlCenterLayout.setVerticalGroup(
            jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlCenterLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPnlCenterLayout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(lblSport))
                    .addComponent(cmbSport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPnlCenterLayout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(lblHoursPerWeek))
                    .addComponent(jSpnHours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPnlCenterLayout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLblWhen))
                    .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jSpnYears, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLblYears)))
                .addContainerGap(23, Short.MAX_VALUE))
        );

        getContentPane().add(jPnlCenter, java.awt.BorderLayout.CENTER);

        jPnlBottom.setName("jPnlBottom"); // NOI18N
        jPnlBottom.setPreferredSize(new java.awt.Dimension(309, 40));

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getActionMap(JDialogSportByPatient.class, this);
        jBtnOk.setAction(actionMap.get("ok")); // NOI18N
        jBtnOk.setText(resourceMap.getString("jBtnOk.text")); // NOI18N
        jBtnOk.setToolTipText(resourceMap.getString("jBtnOk.toolTipText")); // NOI18N
        jBtnOk.setName("jBtnOk"); // NOI18N
        jPnlBottom.add(jBtnOk);

        jBtnCancel.setAction(actionMap.get("cancel")); // NOI18N
        jBtnCancel.setText(resourceMap.getString("jBtnCancel.text")); // NOI18N
        jBtnCancel.setToolTipText(resourceMap.getString("jBtnCancel.toolTipText")); // NOI18N
        jBtnCancel.setName("jBtnCancel"); // NOI18N
        jPnlBottom.add(jBtnCancel);

        getContentPane().add(jPnlBottom, java.awt.BorderLayout.SOUTH);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cmbSport;
    private javax.swing.JButton jBtnCancel;
    private javax.swing.JButton jBtnOk;
    private javax.swing.JLabel jLblWhen;
    private javax.swing.JLabel jLblYears;
    private javax.swing.JPanel jPnlBottom;
    private javax.swing.JPanel jPnlCenter;
    private javax.swing.JSpinner jSpnHours;
    private javax.swing.JSpinner jSpnYears;
    private javax.swing.JLabel lblHoursPerWeek;
    private javax.swing.JLabel lblSport;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the cmbSport
     */
    public javax.swing.JComboBox getCmbSport() {
        return cmbSport;
    }

    /**
     * @return the jSpnHours
     */
    public javax.swing.JSpinner getjSpnHours() {
        return jSpnHours;
    }

  

    /**
     * Confirm operation
     */
    @Action
    public void ok() {
        this.controller.ok();
    }

    /**
     * Cancel operation
     */
    @Action
    public void cancel() {
        this.controller.cancel();
    }

    /**
     * @return the jSpnYears
     */
    public javax.swing.JSpinner getjSpnYears() {
        return jSpnYears;
    }
}
